﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;
using System.Globalization;

namespace RecommendatioNetwork.View.Converter
{
    class ServerStartedToStringConverter : IValueConverter
    {
        //viene invocato al passaggio dalla fonte dati verso l'elelmento di user Interface
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool servedStarted = System.Convert.ToBoolean(value);
            if (servedStarted)
                return "Connesso";
            else
                return "Disconnesso";

        }

        //viene invocato al passaggio dalla user Interface alla fonte dati
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

}




